#include "junix.h"
using namespace std;

void U(char& c)
{
	c=toupper(c);
}

char jtolower(char c)
{
	return tolower(c);
}
int main(int argc, char **argv)
{
	string s="hello,world";
	cout<<s.c_str()<<endl;
	cout<<s.data()<<endl;

	char buf[1024];
	strcpy(buf, s.data());
	strcat(buf, s.c_str());

	cout<<buf<<endl;

	string ss;
	ss.reserve(s.size());
	copy(s.begin(),s.end(),back_inserter(ss) );
	cout<<ss<<endl;

	for_each(ss.begin(),ss.end(), U);
	cout<<ss<<endl;

	string sss;
	sss.reserve(ss.size());
	transform(ss.begin(),ss.end(),
			back_inserter(sss), jtolower);
	cout<<sss<<endl;
}
